package com.dongdongsongcan.app.adapter;

import android.content.Context;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.dongdongsongcan.app.R;
import com.dongdongsongcan.app.control.bean.OrderListData;
import com.su.dolphin.adapter.DpBaseAdapter;

/**
 * Created by Administrator on 2015/12/8 0008.
 */
public class OrderListAdapter extends DpBaseAdapter<OrderListData.Order> {


    private ImageView order_item_shopicon;
    private TextView order_item_shopname;
    private View order_item_shopbtn;
    private TextView order_item_number;
    private TextView order_item_time;
    private TextView order_item_price;
    private TextView order_item_status;

    public OrderListAdapter(Context context) {
        super(context);
    }

    @Override
    public int onGetItemLayout() {
        return R.layout.layout_order_item;
    }

    @Override
    public void onGetView(View convertView, int position) {
        order_item_shopicon = findViewById(convertView, R.id.order_item_shopicon);
        order_item_shopname = findViewById(convertView, R.id.order_item_shopname);
        order_item_shopbtn = findViewById(convertView, R.id.order_item_shopbtn);
        order_item_number = findViewById(convertView, R.id.order_item_number);
        order_item_time = findViewById(convertView, R.id.order_item_time);
        order_item_price = findViewById(convertView, R.id.order_item_price);
        order_item_status = findViewById(convertView, R.id.order_item_status);

        OrderListData.Order order = mDataList.get(position);
        //order_item_shopicon.setVisibility(View.GONE);
        //ImageLoader.i().loadImage(order_item_shopicon, order.get);
        order_item_shopname.setText(order.getShop_name());
        order_item_number.setText(order.getOrder_id() + "");
        order_item_time.setText(order.getOrder_time());
        order_item_price.setText(order.getOrder_total_pay());
        order_item_status.setText(order.getOrder_arrive());//??确认完成

        order_item_shopbtn.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {

            }
        });


    }
}
